<?php


/**
 * 默认控制器
 */
class Controller_Default extends Controller_Abstract{
	function actionIndex(){
		return $this->_redirect(url('index'));
		
        if ($this->_app->currentUserRoles()){// 如果已经登录，就转到任务列表页面
            return $this->_redirect(url('default/main'));
        }else{// 未登录则转到登录页面
            return $this->_redirect(url('admin/login'));
        }
    }
    
	function actionMain(){
		if ($this->_app->currentUserRoles()){// 如果已经登录，就转到任务列表页面
			$user = $this->_app->currentUser();

        	//
            $this->_view['user']=$user;
            $this->_view['now_time'] = time();

            //模块与权限
            $filename = Q::ini('app_config/CONFIG_DIR').'/auth.yaml.php';
            $this->_view['all_perms'] = Helper_YAML::loadCached($filename);

			//soap 模块
			$new = Helper_Soap::getNew(6);	
			$this->_view['new'] = $new;
		}else{// 未登录则转到登录页面
            return $this->_redirect(url('admin/login'));
        }
	}
	
	function actionWelcome(){
		$this->_view['subject'] = "欢迎界面";
	}
}


